if exist "%~1_patched" del "%~1_patched"
xdelta3 -d -s "%~1" "Emerald Dragon EN [v1.0-iso-rev0].xdelta" "%~1_patched"
if exist "Emerald Dragon EN [v1.0-iso] 02.iso" del "Emerald Dragon EN [v1.0-iso] 02.iso"
move "%~1_patched" "Emerald Dragon EN [v1.0-iso] 02.iso"
set isofullname=%~n1
set isobase=%isofullname:~0,-2%
if not exist "Emerald Dragon EN [v1.0-iso] 01.wav" copy "%isobase%01.wav" "Emerald Dragon EN [v1.0-iso] 01.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 02.iso" copy "%isobase%02.iso" "Emerald Dragon EN [v1.0-iso] 02.iso"
if not exist "Emerald Dragon EN [v1.0-iso] 03.wav" copy "%isobase%03.wav" "Emerald Dragon EN [v1.0-iso] 03.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 04.wav" copy "%isobase%04.wav" "Emerald Dragon EN [v1.0-iso] 04.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 05.wav" copy "%isobase%05.wav" "Emerald Dragon EN [v1.0-iso] 05.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 06.wav" copy "%isobase%06.wav" "Emerald Dragon EN [v1.0-iso] 06.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 07.wav" copy "%isobase%07.wav" "Emerald Dragon EN [v1.0-iso] 07.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 08.wav" copy "%isobase%08.wav" "Emerald Dragon EN [v1.0-iso] 08.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 09.wav" copy "%isobase%09.wav" "Emerald Dragon EN [v1.0-iso] 09.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 10.wav" copy "%isobase%10.wav" "Emerald Dragon EN [v1.0-iso] 10.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 11.wav" copy "%isobase%11.wav" "Emerald Dragon EN [v1.0-iso] 11.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 12.wav" copy "%isobase%12.wav" "Emerald Dragon EN [v1.0-iso] 12.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 13.wav" copy "%isobase%13.wav" "Emerald Dragon EN [v1.0-iso] 13.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 14.wav" copy "%isobase%14.wav" "Emerald Dragon EN [v1.0-iso] 14.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 15.wav" copy "%isobase%15.wav" "Emerald Dragon EN [v1.0-iso] 15.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 16.wav" copy "%isobase%16.wav" "Emerald Dragon EN [v1.0-iso] 16.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 17.wav" copy "%isobase%17.wav" "Emerald Dragon EN [v1.0-iso] 17.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 18.wav" copy "%isobase%18.wav" "Emerald Dragon EN [v1.0-iso] 18.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 19.wav" copy "%isobase%19.wav" "Emerald Dragon EN [v1.0-iso] 19.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 20.wav" copy "%isobase%20.wav" "Emerald Dragon EN [v1.0-iso] 20.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 21.wav" copy "%isobase%21.wav" "Emerald Dragon EN [v1.0-iso] 21.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 22.wav" copy "%isobase%22.wav" "Emerald Dragon EN [v1.0-iso] 22.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 23.wav" copy "%isobase%23.wav" "Emerald Dragon EN [v1.0-iso] 23.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 24.wav" copy "%isobase%24.wav" "Emerald Dragon EN [v1.0-iso] 24.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 25.wav" copy "%isobase%25.wav" "Emerald Dragon EN [v1.0-iso] 25.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 26.wav" copy "%isobase%26.wav" "Emerald Dragon EN [v1.0-iso] 26.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 27.wav" copy "%isobase%27.wav" "Emerald Dragon EN [v1.0-iso] 27.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 28.wav" copy "%isobase%28.wav" "Emerald Dragon EN [v1.0-iso] 28.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 29.wav" copy "%isobase%29.wav" "Emerald Dragon EN [v1.0-iso] 29.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 30.wav" copy "%isobase%30.wav" "Emerald Dragon EN [v1.0-iso] 30.wav"
if not exist "Emerald Dragon EN [v1.0-iso] 31.wav" copy "%isobase%31.wav" "Emerald Dragon EN [v1.0-iso] 31.wav"
